import configparser
"""读取ini配置文件"""
filename = "jiban.ini"
#  实例化configParser对象
config = configparser.ConfigParser()
config.read(filename, 'utf-8')
# -sections得到所有的section，并以列表的形式返回
sections = config.sections()
taskNumber = len(sections)

if taskNumber > 0:
    for task in sections:
        if config.has_option(task, 'mode'):
            mode = config.get(task, 'mode')
            print(mode)
        if config.has_option(task, 'times'):
            times = config.get(task, 'times')
            print(times)